<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<%@ page import="com.scalar.chiptrack.utils.ConfigManager"%>

<chiptrack:checkLogon sourcePage="/viewPos.do"/>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<SCRIPT language="JavaScript">
    
    function searchOrderList(theForm)
    {
	theForm.action.value = "SearchPo";
	theForm.submit();
    }

    function GetAllProducts()
    {   
        newWindow = window.open('loadProducts.do','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=500,height=600,resizable=no');
  	newWindow.moveTo(300,30);
  	newWindow.focus();
    }
    
    function assignProduct(passedValue)
    {
	document.purchaseOrderDisplayForm.marketingPartNo.value = passedValue;
	window.focus();
    }

    var dateElement = "";
    function openCalendar(dateValue)
    {
	dateElement = dateValue;
  	newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
  	newWindow.moveTo(550,180);
  	newWindow.focus();
    }

    function assignDate(passedValue)
    {   
	dateElement.value=passedValue;
	window.focus();
    }


function cancelAndGoBack() {
    document.location = "jsp/finance/finance.jsp";
 }

</SCRIPT>


<!-- Top Header Start-->

<%@ include file="/jsp/includes/header.jsp" %>

<!-- Top Header End-->
  
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->

	<%@ include file="/jsp/finance/purchase_order_menu.jsp" %>

<!-- end of the side navigations -->
</TD>

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>

<!-- from here your body starts -->
<center><span class="NArialW">View Purchase Orders</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10>
<html:form name="purchaseOrderDisplayForm" method="post" action="/viewPos" type="com.scalar.chiptrack.finance.forms.PurchaseOrderDisplayForm">
 <table border="0" width="90%" align=right>
 <tr><td>
 <table border="0" width="100%" align=right>
    <tr>
      <td width="25%"><font class="NArialL">Product Name(Marketing Part #)</font></td>
      <td width="15%"><font class="NArialL">
             	<html:text property="marketingPartNo" styleClass="txfield" /></td>
      <td colspan='3'> <font class="NArialL">(OR) &nbsp;&nbsp&nbsp;&nbsp;
        Please <html:link styleClass="NArialL" href="javascript:GetAllProducts();" >click here</html:link>
            to select</font>
      </td>
      <td width="10%">&nbsp;</td>
    </tr>
    <tr>
      <td width="25%"><font class="NArialL">Purchase Order #</font></td>
      <td width="15%"><font class="NArialL"><html:text property="purchaseOrderNo" size="20" styleClass="txfield" /></td>
      <td width="10%">&nbsp;</td>
      <td width="15%"><font class="NArialL">Vendor</font></td>
      <td width="15%"><font class="NArialL">
        <html:select property="vendorId" styleClass="txfield">
      	    <html:option value="" />
            <html:options collection="vendorList" property="value" labelProperty="label"/>
        </html:select>      	
      </td>
       </tr>
    <tr>
      <td width="25%"><font class="NArialL">From-Date</font></td>
      <td width="20%"><font class="NArialL">
      	<html:text property="fromDate" size="20" styleClass="txfield" /></font>&nbsp;&nbsp;&nbsp;
      	<a href="javascript:openCalendar(document.purchaseOrderDisplayForm.fromDate);">
            <img src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=18 width=18 border='0'></a></td>
      <td width="10%">&nbsp;</td>
      <td width="15%"><font class="NArialL">To-Date</font></td>
      <td width="20%"><font class="NArialL">
      	<html:text property="toDate" size="20" styleClass="txfield" /></font>&nbsp;&nbsp;&nbsp;
      	<a href="javascript:openCalendar(document.purchaseOrderDisplayForm.toDate);">
            <img src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=18 width=18 border='0'></a></td>
      
    </tr>
    <tr><td colsapn=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
    <tr>
      <td colspan=5 align=center class="NArialL">
        <html:radio property="poType" value="OPEN" /> Open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <html:radio property="poType" value="CLOSED"  /> Closed&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <html:radio property="poType" value="OUTSTANDING" /> Outstanding&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <html:radio property="poType" value="PENDING" /> Pending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <html:radio property="poType" value="All"  /> All
      </td>
    </tr>
    <tr><td colsapn=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
    <tr>
      <td colspan=5 align=center>
         <a href="javascript:searchOrderList(document.purchaseOrderDisplayForm);"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17"></a>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            
            <a href="javascript:cancelAndGoBack();" onMouseOver="window.status='Click here to go back to Finance menu';return true" onMouseOut="window.status='';return true">
           <img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"></a></td>
    </tr>
    
   </table>
   </td></tr>
   <tr><td><img height=10 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td></tr>
   <logic:equal name="showList" value="TRUE">
   <tr><td>
   <table border="0" width="100%" bordercolor="#FFFFFF" align=right>
	<tr>
	  <td width="10%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Purchase Order #</font></td>
	  <td width="25%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Vendor Name</font></td>
	  <td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Amount</font></td>
	  <td width="30%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Status / Hold</font></td>
	  <td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Actions</font></font></td>
	</tr>
	<logic:iterate id="DisplayPurchaseOrders" name="poList">
	<tr>
	  <td width="10%" align="center" bgcolor="#DEE1E2"><font class="NArialL"><bean:write name="DisplayPurchaseOrders" property="purchaseOrderNo"  /></font></td>
	  <td width="25%" align="center" bgcolor="#DEE1E2"><font class="NArialL"><bean:write name="DisplayPurchaseOrders" property="vendorName" /></font></td>
	  <td width="15%" align="center" bgcolor="#DEE1E2"><font class="NArialL"><bean:write name="DisplayPurchaseOrders" property="totalAmount" /></font></td>
          <td width="30%" align="center" bgcolor="#DEE1E2"><font class="NArialL"><bean:write name="DisplayPurchaseOrders" property="status" /></font></td>
	  <td width="15%" align="center" bgcolor="#DEE1E2"><font class="NArialL">
            <A HREF="<%=chipTracContext%>/viewPo.do?purchaseOrderId=<bean:write name="DisplayPurchaseOrders" property="purchaseOrderId"/>" >View</A>
		</font></td>
	</tr>
        </logic:iterate>
    </table>
    </logic:equal>
    </td></tr>
</table>

<input type="hidden" name="action" value="">
</html:form>


<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->

</BODY>
</HTML>
